<template>
    <van-tabbar v-model="active" :fixed="false">
        <van-tabbar-item :to="{ name: 'Index' }" name="Index" icon="home-o">客户</van-tabbar-item>
        <van-tabbar-item :to="{ name: 'Analys' }" name="Analys" icon="chart-trending-o">统计</van-tabbar-item>
        <van-tabbar-item :to="{ name: 'Home' }" name="Home" icon="friends-o">我的</van-tabbar-item>
      </van-tabbar>
</template>

<script setup>
import {ref,onMounted} from 'vue'
import {useRouter} from "vue-router"

const router = useRouter()

const active = ref('')

onMounted(()=>{
  const {currentRoute} = router
  active.value = currentRoute._value.name
})
</script>